package com.ruoyi.bearing.service.Impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bearing.mapper.BearingDatasetMapper;
import com.ruoyi.bearing.domain.BearingDataset;
import com.ruoyi.bearing.service.IBearingDatasetService;

/**
 * 数据集Service业务层处理
 *
 * @author ruoyi
 * @date 2023-07-12
 */
@Service
public class BearingDatasetServiceImpl implements IBearingDatasetService {
    @Autowired
    private BearingDatasetMapper bearingDatasetMapper;

    /**
     * 查询数据集
     *
     * @param datasetId 数据集主键
     * @return 数据集
     */
    @Override
    public BearingDataset selectBearingDatasetByDatasetId(String datasetId) {
        return bearingDatasetMapper.selectBearingDatasetByDatasetId(datasetId);
    }

    /**
     * 查询数据集列表
     *
     * @param bearingDataset 数据集
     * @return 数据集
     */
    @Override
    public List<BearingDataset> selectBearingDatasetList(BearingDataset bearingDataset) {
        return bearingDatasetMapper.selectBearingDatasetList(bearingDataset);
    }

    /**
     * 新增数据集
     *
     * @param bearingDataset 数据集
     * @return 结果
     */
    @Override
    public int insertBearingDataset(BearingDataset bearingDataset) {
        bearingDataset.setCreateTime(DateUtils.getNowDate());
        return bearingDatasetMapper.insertBearingDataset(bearingDataset);
    }

    /**
     * 修改数据集
     *
     * @param bearingDataset 数据集
     * @return 结果
     */
    @Override
    public int updateBearingDataset(BearingDataset bearingDataset) {
        bearingDataset.setUpdateTime(DateUtils.getNowDate());
        return bearingDatasetMapper.updateBearingDataset(bearingDataset);
    }

    /**
     * 批量删除数据集
     *
     * @param datasetIds 需要删除的数据集主键
     * @return 结果
     */
    @Override
    public int deleteBearingDatasetByDatasetIds(String[] datasetIds) {
        return bearingDatasetMapper.deleteBearingDatasetByDatasetIds(datasetIds);
    }

    /**
     * 删除数据集信息
     *
     * @param datasetId 数据集主键
     * @return 结果
     */
    @Override
    public int deleteBearingDatasetByDatasetId(String datasetId) {
        return bearingDatasetMapper.deleteBearingDatasetByDatasetId(datasetId);
    }
}
